home *** CD-ROM | disk | FTP | other *** search
/ Browser - Artopolis 97 / browser.iso / mac / artrope / artrope.dir / 00005_Script_Cut -n- paste Lingo handlers MAC < prev    next >
Text File  |  1997-10-08  |  3KB  |  109 lines

  1. --Cut and paste Lingo handlers
  2. --PrefsFolder XObject version 1.01, 7/24/96
  3. --Copyright ⌐ 1996 Glenn M. Picher, Dirigo Multimedia
  4. --Email: gpicher@maine.com
  5. --Web: http://www.maine.com/shops/gpicher
  6. --Phone: (207)767-8015 (South Portland, Maine, USA)
  7.  
  8. --Distribute freely. No licensing required.
  9.  
  10. --Also distributed by g/matter, inc.
  11. --Email: support@gmatter.com
  12. --Web: http://www.gmatter.com
  13. --Phone: (415)243-0394
  14.  
  15. -- End user handlers ----------------------------------------------
  16.  
  17. on getPrefsFolder
  18.   global gPrefsFolderObject
  19.   insurePrefsFolder()
  20.   set theFolder = gPrefsFolderObject(mPrefsFolder)
  21.   if char 1 to 7 of theFolder = ":Error:" then
  22.     warning theFolder
  23.   end if
  24.   return theFolder
  25. end
  26.  
  27. on showWarnings
  28.   global gShowWarnings
  29.   set gShowWarnings to TRUE
  30. end
  31.  
  32. on hideWarnings
  33.   global gShowWarnings
  34.   set gShowWarnings to FALSE
  35. end
  36.  
  37. -- Support handlers ----------------------------------------------
  38.  
  39. --These handlers are called from the handlers above.
  40. --You needn't call them directly (although you might wish to
  41. --include openPrefsFolder() in your startMovie() handler, and
  42. --closePrefsFolder() in your stopMovie() handler or final 'quit'
  43. --button.
  44.  
  45. --Change the pathname or filename in the openPrefsFolder() handler
  46. --if the XObject is not located in the same place as the
  47. --Director movie or projector. Change closePrefsFolder()
  48. --similarly. 
  49.  
  50. on openPrefsFolder
  51.   if xobjectLoaded("PrefsFolder") then return TRUE
  52.   if the machineType < 256 then
  53.     openxlib the pathname & "XTRAS:"&"PrefsFolder XObject"
  54.   else
  55.     warning "PrefsFolder is designed only for the Macintosh!"
  56.     return FALSE
  57.   end if
  58.   if not xobjectLoaded("PrefsFolder") then
  59.     warning "PrefsFolder XObject didn't register."
  60.     return FALSE
  61.   end if
  62.   return TRUE
  63. end
  64.  
  65. on closePrefsFolder
  66.   global gPrefsFolderObject
  67.   if objectP(gPrefsFolderObject) then gPrefsFolderObject(mDispose)
  68.   if not xobjectLoaded("PrefsFolder") then return TRUE
  69.   if the machineType < 256 then
  70.     closexlib the pathname & "XTRAS:" & "PrefsFolder XObject"
  71.   else
  72.     warning "PrefsFolder is designed only for the Macintosh!"
  73.     return FALSE
  74.   end if
  75.   if xobjectLoaded("PrefsFolder") then
  76.     warning "PrefsFolder XObject wouldn't close-- do objects still exist?"
  77.     return FALSE
  78.   end if
  79.   return TRUE
  80. end
  81.  
  82. on insurePrefsFolder
  83.   global gPrefsFolderObject
  84.   if objectP(gPrefsFolderObject) then return TRUE
  85.   if not openPrefsFolder() then
  86.     warning "insurePrefsFolder(): openPrefsFolder() failed"
  87.     abort
  88.   end if
  89.   put PrefsFolder(mNew) into gPrefsFolderObject
  90.   if not objectP(gPrefsFolderObject) then
  91.     warning "insurePrefsFolder(): couldn't create object"
  92.     abort
  93.   end if
  94.   return true
  95. end
  96.  
  97. on xobjectLoaded theName
  98.   if not stringP(theName) then 
  99.     warning "xobjectLoaded(): theName not a string"
  100.     return false
  101.   end if
  102.   return objectP(factory(theName))
  103. end
  104.  
  105. on warning theMessage
  106.   global gShowWarnings
  107.   if not (gShowWarnings = TRUE) then return
  108.   alert theMessage
  109. end